package com.purong.purong.util;

import com.alibaba.fastjson.JSON;
import com.purong.purong.bean.AdListBean;

import org.json.JSONObject;

/**
 * Created by Administrator on 2017/3/9.
 */
public class CustomJsonParse {


    public static AdListBean parseAd(String content, String code){
        if (content==null||code==null)
            return null;
        try {
            JSONObject object=new JSONObject(content);
            String adList=object.getString(code);
            if (adList!=null){
                AdListBean bean= JSON.parseObject(adList,AdListBean.class);
                return bean;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return null;
    }
}

